package com.app.store.dao;

import com.app.store.model.AppVersion;
import com.app.sysmodule.dao.BaseDao;
import com.app.sysmodule.exception.DBException;

import java.util.List;

/**
 * Created by song on 2017/12/20.
 */
public interface StoreDao extends BaseDao<AppVersion> {

//    AppVersion getVersion(String version) throws DBException;

    /**
     * 根据服务端获取app版本
     * @param version
     * @param type
     * @param source
     * @return
     * @throws DBException
     */
    AppVersion getVersion1(String version, String type,String source)throws DBException;

    /**
     * 获取最后一次强制升级版本
     * @param version
     * @param type
     * @param source
     * @return
     * @throws DBException
     */
    AppVersion getVersion2(String version, String type,String source)throws DBException;

    /**
     * 根据版本号 操作系统查找数据
     * @param type
     * @param version
     * @return
     */
    AppVersion findVersionByTypeAndVersion(String type, String version) throws DBException;

    /**
     * 获取最新app版本
     * @param type
     * @param source
     * @return
     */
    AppVersion getVersionByType(String type, String source) throws DBException;

    /**
     * 获取要删除的version版本信息
     * @param serverVersion
     * @param type
     * @param size 默认保留5条
     * @return
     */
    List<AppVersion> getDeleteInfo(String serverVersion, String type, Integer size) throws DBException;

    /**
     * 删除数据库
     * @param idList
     */
    void batchDelete(List<Long> idList) throws DBException;

    List<String> getServerVersionList(String source) throws DBException;
}
